home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib1 / v_01_07 / 1n07036c < prev    next >
Encoding:
Text File  |  1995-11-01  |  346 b   |  17 lines

  1.  
  2. LISTING 6
  3. #define SEND_TIMEOUT 5 * 1000     /* 5 seconds, in ms. */
  4.  
  5. void timeout(int nd)
  6. {
  7.     long tmo =   SEND_TIMEOUT;
  8.  
  9.     /* Set the timeout option, so our reads won't wait forever. */
  10.     if ((set_option(nd, DGRAM, NET_OPT_TIMEOUT,
  11.             (char far *)tmo, 4)) != 0) {
  12.         printf("Send: couldn't set timeout option.\n");
  13.         exit(1);
  14.     }
  15. }
  16.  
  17.